<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>搜索结果</title>
    <link rel="icon" type="image/png" sizes="16x16" href="../../static/icons/favicon.svg">
    <link rel="stylesheet" href="{{ url_for('static', filename='base.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='user/css/home.css') }}">
    <link rel="stylesheet" href="../../static/user/css/order.css">
    <link rel="stylesheet" href="../../static/user/css/search.css">
    <script src="../../static/jQuery.js"></script>
    <script src="../../static/user/js/nav.js"></script>
    <script src="../../static/user/js/order.js"></script>
</head>
<body>

<!-- header section strats -->
<div class="header">
    <div class="w">
        <a class="index" href="{{ url_for('user.index') }}">
            <span>
              Store
            </span>
        </a>
        <ul class="list">
            <li class="part">
                <a class="link" href="{{ url_for('user.index') }}">首页</a>
            </li>
            <li class="part">
                <a class="link" href="{{ url_for('user.car') }}">购物车</a>
            </li>
            <li class="part">
                <a class="link" href="{{ url_for('user.orders') }}">我的订单</a>
            </li>
            <li class="part">
                <a class="link" href="{{ url_for('user.about') }}">全部商品</a>
            </li>
            <li class="part search-li">
                <form action="{{ url_for('user.search') }}" method="get">
                    <input class="search" type="text" name="keyword" value="" placeholder="书名/作者名">
                    <button type="submit">
                        <img class="search-icon" style="width: 20px;height: 20px;" src="../../static/icons/search.svg">
                    </button>
                </form>
            </li>
            <li class="part">
                {% if user %}
                <a href="javascript:;" class="logout">
                    欢迎，{{ user.name }}
                </a>
                {% else %}
                <a class="link" href="{{ url_for('user.login') }}">
                    登录
                </a>
                {% endif %}
            </li>
        </ul>
    </div>
</div>
<!-- end header section -->


<!--列表开始-->
<div class="items w">
    <ul>
        {% if books %}
        {% for book in books %}
        <li data-id="{{book.book_id}}">
            <a href="{{url_for('user.detail',book_id = book.book_id)}}">
                <img src="{{book.photo}}" alt="">
            </a>
            <div class="detail">
                <a href="{{url_for('user.detail',book_id = book.book_id)}}">
                    <p class="xinxi">
                        {{book.book_name}}<span>作者：{{book.book_author}}</span></p>
                    <p class="miaoshu">{{book.desc}}</p>
                </a>
            </div>

        </li>
        {% endfor %}
        {% else %}
        <div class="space">无结果</div>
        {% endif %}
    </ul>

</div>
<!--列表开始-->
</body>
</html>